//package com.xiaoyu.izf.config;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.*;
//import org.springframework.web.servlet.handler.HandlerInterceptorAdapter;
//
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import javax.servlet.http.HttpSession;
//
//@Configuration
//public class WebSecurityConfig implements WebMvcConfigurer {
//    @Autowired
//    private UserSecurityInterceptor securityInterceptor;
//
//    /**
//     * 登录session key
//     */
//    public final static String SESSION_KEY = "user";
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
//        registry.addResourceHandler("/static/**").addResourceLocations("classpath:/static/");
//        WebMvcConfigurer.super.addResourceHandlers(registry);
//    }
//
//
//    public void addInterceptors(InterceptorRegistry registry) {
//        InterceptorRegistration addInterceptor = registry.addInterceptor(securityInterceptor);
//        addInterceptor.addPathPatterns("/**").excludePathPatterns("/static/**");
//        addInterceptor.excludePathPatterns("/admin_user/login");
//        addInterceptor.excludePathPatterns("/check_code/pic");
//        addInterceptor.excludePathPatterns("/error");
//        addInterceptor.excludePathPatterns("/test");
//        addInterceptor.excludePathPatterns("/test/**");
//        addInterceptor.excludePathPatterns("/test2/**");
//        addInterceptor.excludePathPatterns("/login**");
//    }
//
//}
